// ==UserScript==
// @name			Google Analytics Row Limit
// @author			Erik Vold
// @namespace		gaRowLimit
// @include			https://www.google.com/analytics/reporting/*
// @include			https://adwords.google.com/analytics/reporting/*
// @version			0.1
// @datecreated		2009-07-19
// @lastupdated		2009-07-19
// @description		Allows you to change row limit easily in Google Analytics via Greasemonkey menu command.
// ==/UserScript==

if ( unsafeWindow.table ) {
	gaRowLimit = function(str){
		if (!str && unsafeWindow.ubiquityGMInput && unsafeWindow.ubiquityGMInput.length) {
			var str = unsafeWindow.ubiquityGMInput;
			
			// reset for next execution
			unsafeWindow.ubiquityGMInput = "";
		}
		else 
			if (!str) {
				var str = prompt("Row Limit:");
			}
		
		unsafeWindow.table._toggleRowShow(str);
		return true;
	};

	GM_registerMenuCommand("Row Limit", gaRowLimit, "", "", "r");
}